import request from '/@/utils/request';

export async function queryOrgans(params?: object) {
	return await request({
		url: '/organ/pager',
		method: 'get',
		params,
	});
}
//新增机构
export async function post(params?: object) {
	return await request({
		url: '/organ/post',
		method: 'post',
		data: params,
	});
}
//编辑机构
export async function put(params?: object) {
	return await request({
		url: '/organ/put',
		method: 'put',
		data: params,
	});
}
export async function saveOrgan(params?: any) {
	if (params.id > 0) {
		return await put(params);
	} else {
		return await post(params);
	}
}
//删除机构
export async function delOrgan(params?: object) {
	return await request({
		url: '/organ/delete',
		method: 'delete',
		data: params,
	});
}
